
//
//  ZXStatusCell.m
//  ZXOCWeiBo
//
//  Created by mac on 15/12/10.
//  Copyright © 2015年 itcast. All rights reserved.
//
#import "ZXStatusCell.h"
#import "ZXStatusDetailView.h"
#import "ZXStatusToolBar.h"

@interface ZXStatusCell()

@property(nonatomic,weak)ZXStatusDetailView* detailView;
@property(nonatomic,weak)ZXStatusToolBar * toolBar;

@end

@implementation ZXStatusCell
+(instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString * ID = @"StatusCell";
    ZXStatusCell * cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil)
    {
        cell = [[ZXStatusCell alloc]initWithStyle:0 reuseIdentifier:ID];
    }
    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.backgroundColor = [UIColor clearColor];
        
        //添加详情的VIew
        ZXStatusDetailView * detailView = [[ZXStatusDetailView alloc]init];
        [self.contentView addSubview:detailView];
        self.detailView = detailView;
//        detailView.backgroundColor = [UIColor yellowColor];
        
        // 添加微博工具条
        ZXStatusToolBar * toolBar = [[ZXStatusToolBar alloc]init];
        
        self.toolBar = toolBar;
        [self.contentView addSubview:toolBar];
//        toolBar.backgroundColor = [UIColor redColor];
    }
    return self;
}
//设置所有的cell的frm 和数据
-(void)setStatusCellFrm:(ZXStatusCellFrm *)statusCellFrm
{
    _statusCellFrm = statusCellFrm;
//    设置detailView的frm
    self.detailView.detailFrm = statusCellFrm.detailFrm;
    
//    设置toolbar的frm
    self.toolBar.frame = statusCellFrm.toolBarFrm;
    self.toolBar.status = statusCellFrm.statuses;
}
@end
